﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using ThietBiSo.LinQDB;
using ThietBiSo.Models;

namespace ThietBiSo.Controllers
{
    public class tuyendungController : Controller
    {
        //
        // GET: /footer/

        MTuyenDung mtd = new MTuyenDung();
        TuyenDung td = new TuyenDung();

        public ActionResult Index()
        {
            var v = mtd.FindAll_Web();
            ViewData["tuyendungs"] = v;
            return View();
        }    


        public ActionResult tuyendung()
        {
            var v = mtd.FindAll();
            ViewData["tuyendungs"] = v;
            return View();
        }
    
        [HttpPost]
        public ActionResult tuyendung(FormCollection collection)
        {
            try
            {

                td.Id = 1;
                td.NoiDung = System.Net.WebUtility.HtmlDecode(collection.Get("ChiTiet"));
                mtd.Update(td);
                return RedirectToAction("tuyendung");
            }
            catch
            {
                return View();
            }
        }

    }
}
